#include <wx/wx.h>
#include <wx/artprov.h>

class Ident : public wxFrame
{
public:
    Ident(const wxString &title);
};

Ident::Ident(const wxString &title)
    : wxFrame(NULL, wxID_ANY, title, wxDefaultPosition, wxSize(300, 200))
{
    // wxImage::AddHandler(new wxPNGHandler);
    wxInitAllImageHandlers();
    wxPanel *panel = new wxPanel(this, -1);

    wxGridSizer *grid = new wxGridSizer(3, 2, 5, 5);

    wxBitmap bitmap = wxArtProvider::GetBitmap(wxART_INFORMATION, wxART_OTHER);
    if (!bitmap.IsOk())
    {
        // 如果系统没有提供或获取失败，可以回退到自定义图标
        std::cout << "No bitmap found for wxART_INFORMATION" << std::endl;
    }
    wxBitmapButton *button = new wxBitmapButton(panel, wxID_CANCEL, bitmap);
    button->SetLabelText("Cancel");

    // grid->Add(new wxButton(panel, wxID_CANCEL), 0, wxTOP | wxLEFT, 9);
    grid->Add(button, 0, wxTOP | wxLEFT, 9);
    grid->Add(new wxButton(panel, wxID_DELETE), 0, wxTOP, 9);
    grid->Add(new wxButton(panel, wxID_SAVE), 0, wxLEFT, 9);
    grid->Add(new wxButton(panel, wxID_EXIT));
    grid->Add(new wxButton(panel, wxID_STOP), 0, wxLEFT, 9);
    grid->Add(new wxButton(panel, wxID_NEW));

    panel->SetSizer(grid);
    Centre();
}

class MyApp : public wxApp
{
public:
    virtual bool OnInit();
};

bool MyApp::OnInit()
{
    Ident *frame = new Ident("Identifiers");
    frame->Show(true);
    return true;
}

wxIMPLEMENT_APP(MyApp);